//上升效果
function Rise_LEVELUP(){

    this.speedX = 0;
    this.speedY = 0;
    this.posX = 0;
    this.posY = 0;
    this.visible = false;
    this.showCount = 0;
    this.showTotal = 0;
    this.img;

    this.InitEffect = function(width, height, speedX, speedY, centerX, centerY, img, showTotal) {
        this.speedX = speedX;
        this.speedY = speedY;
        this.posX = centerX-width/2;
        this.posY = centerY - height/2;
        this.visible = true;
        this.img = img;
        this.showTotal = showTotal;
        this.showCount = 0;
    };

    this.update = function(){
        if(this.visible){
            this.posX = this.posX + this.speedX;
            this.posY = this.posY + this.speedY;
            this.showCount++;
            if(this.showCount == this.showTotal){
                this.visible = false;
            }
        }
    }

    this.paint = function(drawCanvas){
        if(this.visible){
            drawCanvas.drawImage(this.img, this.posX, this.posY);
        }
    }
}

function Rise_StayFirst(){

    this.speedX = 0;
    this.speedY = 0;
    this.posX = 0;
    this.posY = 0;
    this.visible = false;
    this.showTotal = 0;
    this.stayTotal = 0;
    this.img;

    this.InitEffect = function(width, height, speedX, speedY, centerX, centerY, img, showTotal, stayTotal) {
        this.speedX = speedX;
        this.speedY = speedY;
        this.posX = centerX-width/2;
        this.posY = centerY - height/2;
        this.visible = true;
        this.img = img;
        this.showTotal = showTotal;
        this.stayTotal = stayTotal;
    };

    this.update = function(){
        if(this.visible){
            if(this.stayTotal > 0){
                this.stayTotal--;
            }
            else{
                this.posX = this.posX + this.speedX;
                this.posY = this.posY + this.speedY;
                this.showTotal--;
                if(this.showTotal == 0){
                    this.visible = false;
                }
            }
        }
    }

    this.paint = function(drawCanvas){
        if(this.visible){
            drawCanvas.drawImage(this.img, this.posX, this.posY);
        }
    }
}